/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.compomics.fspike.contentprovider.webprovider;

import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import javax.xml.parsers.ParserConfigurationException;

/**
 *
 * @author Kenneth
 */
public class PubMedContentProvider {

    private static final String pubMedURL = "http://www.ncbi.nlm.nih.gov/pmc/?term=--COMPOMICS--";

    /**
     *
     * @param term this term will be used to attempt to find a relevant
     * wikipedia page
     *
     * @returnz an URL to the relevant page or throws a FileNotFound exception if
     * none exist
     * @throws MalformedURLException
     * @throws IOException
     * @throws ParserConfigurationException
     */
    public static URL getRelevantURL(String term) throws MalformedURLException, IOException, ParserConfigurationException {
        URL url = new URL(pubMedURL.replace("--COMPOMICS--", term.replace(" ", "%20")));
        return url;
    }
}
